package com.wish.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wish.dto.RegionDto;
import com.wish.entity.SysRegion;
import com.wish.service.ISysRegionService;
import com.wish.vo.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.swing.plaf.synth.Region;
import java.util.List;

/**
 * <p>
 * 地区表 前端控制器
 * </p>
 *
 * @author 五组
 * @since 2021-03-22
 */
@RestController
@RequestMapping("/wish/sys-region")
public class SysRegionController {

    @Autowired
    private ISysRegionService regionService;

    @RequestMapping("getArea")
    public ResultEntity getArea(Integer pid){
        QueryWrapper<SysRegion> wrapper = new QueryWrapper<>();
        wrapper.eq("PARENT_ID",pid);
        List<SysRegion> list = regionService.list(wrapper);
        return ResultEntity.ok(list);
    }

}
